//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Diagnostics.Contracts;
using OpenLS.Spreadsheet.Expressions;

namespace OpenLS.Spreadsheet
{
    class WorksheetEvaluationContext: WorksheetLevelEvaluationContext
    {
        private readonly Worksheet _worksheet;

        public WorksheetEvaluationContext(Worksheet worksheet) 
        {
            Contract.Requires(worksheet != null);
            _worksheet = worksheet;
        }
        public override Cell Target
        {
            get { return null; }
        }

        public override CellRelativeAddress Offset
        {
            get { return new CellRelativeAddress(); }
        }

        public override Worksheet Worksheet
        {
            get
            {
                return _worksheet;
            }
        }

        internal override EvaluationContext CreateOffseted(CellRelativeAddress cellRelativeAddress)
        {
            return new WorksheetEvaluationContext(_worksheet);
        }
    }
}